<?php

namespace Home\Model;
use Think\Model;

class ArticleModel extends Model{
    /**
     *从文章表里面将详细的文章信息查询出来 
     */
    public function article(){
        $id = I('id');
        $where=array('type_id'=>array('eq',$id));
        $data = M('article')->field('id,type_id,title,add_time,img,content')->where($where)->order('add_time desc')->select();
        return $data;
    }
    public function content(){
        $arr['id'] = I('id');
        $data = M('article')->field('title,add_time,content')->where($arr)->find();
        return $data;
    }
    
}
